#!/bin/bash
APP_NAME=gomaxai-proxy-server

echo "APP name is ${APP_NAME}"

while true
do

    PID=$(ps -ef | grep ${APP_NAME} | grep -v grep | awk '{print $2}')

    echo "progress Pid = ${PID}"

    if [[ -z "$PID" ]] ;then
            echo "start ${APP_NAME}"
#            nohup ${APP_NAME} > /dev/null 2>&1  &
            nohup ./${APP_NAME} > nohup.output.log 2>&1 &
    else
            echo "${APP_NAME} is running"
    fi;

	sleep 10
done


